package com.cmf.myproject.controller.merchant.login;

import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.cmf.myproject.controller.boss.login.dto.BossLoginForm;
import com.system.core.controller.ControllerBase;

import lombok.extern.slf4j.Slf4j;

@Controller
@RequestMapping(value = "merchant")
@Slf4j
public class LoginMerchantController extends ControllerBase{
	
	private String loginTemplate = "merchant/login-layui";
	
	@RequestMapping(value = "login",method = RequestMethod.GET)
	public String login() {
		if (SecurityUtils.getSubject().isRemembered()
				|| SecurityUtils.getSubject().isAuthenticated()) {
			return "redirect:/merchant/main";
		}
		this.getModelMap().put("loginForm", new BossLoginForm());
		return loginTemplate;
	}
}
